import request from './request.js'


export const getDataByIP = () => {
  return request({
    method: 'GET',
    url: '/ip?&key=6e136f9b1a7fb205180fe7d987ff84d1',
  })
}


export const getCode = (city) => { 
    return request({
      method: 'GET',
      url: `/geocode/geo?address=${city}&key=6e136f9b1a7fb205180fe7d987ff84d1`,
    })
}

export const getTodayWeather = (code) => { 
    return request({
      method: 'GET',
      url: `/weather/weatherInfo?city=${code}&key=6e136f9b1a7fb205180fe7d987ff84d1&extensions=base`,
    })
}

export const getRecentWeather = (code) => { 
    return request({
      method: 'GET',
      url: `/weather/weatherInfo?city=${code}&key=6e136f9b1a7fb205180fe7d987ff84d1&extensions=all`,
    })
}